package com.sky.business.sys.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sky.common.enums.ControlMode;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 相机云台配置类
 */
@Data
@TableName(value = "d_camera_config", autoResultMap = true)
public class CameraConfig implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 摄像头设备ID
     */
    @Schema(description = "设备ID")
    @TableField(value = "camera_device_id")
    private String cameraDeviceId;

    /**
     * 摄像头设备名称
     */
    @Schema(description = "设备名称")
    @TableField(value = "camera_device_name")
    private String cameraDeviceName;

    /**
     * 摄像头IP地址
     */
    @Schema(description = "设备IP")
    @TableField(value = "camera_ip")
    private String cameraIp;

    /**
     * 控制指令topic
     */
    @TableField(value = "dispatcher_topic")
    @Schema(description = "控制指令Topic")
    private String dispatcherTopic;

    /**
     * 摄像头端口
     */
    @Schema(description = "设备端口")
    @TableField(value = "camera_port")
    private String cameraPort;

    /**
     * 摄像头rtsp端口
     */
    @Schema(description = "设备rtsp端口")
    @TableField(value = "camera_rtsp_port")
    private String cameraRtspPort;

    /**
     * ONVIF用户名
     */
    @Schema(description = "onvif用户名")
    @TableField(value = "onvif_user")
    private String onvifUser;

    /**
     * ONVIF密码
     */
    @Schema(description = "onvif密码")
    @TableField(value = "onvif_passwd")
    private String onvifPasswd;

    /**
     * 摄像头纬度
     */
    @Schema(description = "设备纬度")
    @TableField(value = "camera_longitude")
    private String cameraLongitude;

    /**
     * 摄像头经度
     */
    @Schema(description = "设备经度")
    @TableField(value = "camera_latitude")
    private String cameraLatitude;

    /**
     * 摄像头海拔
     */
    @Schema(description = "设备海拔高度")
    @TableField(value = "camera_altitude")
    private String cameraAltitude;

    /**
     * 最后一次心跳时间
     */
    @Schema(hidden = true)
    @TableField(value = "last_heart_beat_time")
    private Date lastHeartBeatTime;

    /**
     * 水平误差角
     */
    @Schema(description = "设备水平误差角")
    @TableField(value = "pan_angle")
    private String panAngle;

    /**
     * 垂直误差角
     */
    @Schema(description = "设备垂直误差角")
    @TableField(value = "tilt_angle")
    private String tiltAngle;

    /**
     * 摄像头最小焦距
     */
    @Schema(description = "设备最小焦距")
    @TableField(value = "camera_focal_len_min")
    private String cameraFocalLenMin;

    /**
     * 摄像机最大焦距
     */
    @Schema(description = "摄像机最大焦距")
    @TableField(value = "camera_focal_len_max")
    private String cameraFocalLenMax;

    /**
     * 摄像头变焦范围最大值
     */
    @Schema(description = "设备最大焦距")
    @TableField(value = "camera_zoom_range_max")
    private String cameraZoomRangeMax;

    /**
     * 摄像头垂直旋转范围最小值
     */
    @Schema(description = "设备垂直旋转范围最小值")
    @TableField(value = "camera_tilt_range_min")
    private String cameraTiltRangeMin;

    /**
     * 摄像头垂直旋转范围最大值
     */
    @Schema(description = "设备垂直旋转范围最大值")
    @TableField(value = "camera_tilt_range_max")
    private String cameraTiltRangeMax;


    /**
     * 原始流推流地址
     */
    @Schema(description = "设备推流地址")
    @TableField(value = "push_stream")
    private String pushStream;

    /**
     * ai推流地址
     */
    @Schema(description = "ai推流地址")
    @TableField(value = "ai_push_stream")
    private String aiPushStream;

    /**
     * 拉流地址
     */
    @Schema(description = "设备拉流地址")
    @TableField(value = "pull_stream")
    private String pullStream;

    /**
     * ai拉流地址
     */
    @Schema(description = "设备AI流拉流地址")
    @TableField(value = "ai_pull_stream")
    private String aiPullStream;


    /**
     * 自动变倍（开关）
     */
    @Schema(description = "自动变倍开关", defaultValue = "true")
    @TableField(value = "auto_zoom")
    private Boolean autoZoom = true;

    /**
     * 像元尺寸
     */
    @Schema(description = "像元尺寸", defaultValue = "2")
    @TableField(value = "pixel_size")
    private String pixelSize = "2";

    /**
     * 设备类型，1: 海康 2:大华 5: 25倍
     */
    @Schema(description = "设备类型")
    @TableField(value = "device_type")
    private String deviceType = "1";


    /**
     * 设备tilt是否相反
     */
    @Schema(description = "垂直方向是否反转")
    @TableField(value = "reverse")
    private Boolean reverse = false;

    /**
     * 是否智能设备
     */
    @Schema(description = "是否智能设备")
    @TableField(value = "smart")
    private Boolean smart;

    /**
     * 是否启动转推
     */
    @Schema(description = "是否开启转推")
    @TableField(value = "pub_stream_enabled")
    private Boolean pubStreamEnabled = true;

    /**
     * 所在组id
     */
    @Schema(description = "所属组别ID")
    @TableField(value = "group_id")
    private Integer groupId;

    /**
     * 制造商
     */
    @Schema(description = "设备制造商")
    @TableField(value = "manufacturer")
    private String manufacturer;

    /**
     * 型号
     */
    @Schema(description = "型号")
    @TableField(value = "model")
    private String model;

    /**
     * 固件版本
     */
    @Schema(description = "固件版本")
    @TableField(value = "firmware_version")
    private String firmwareVersion;

    /**
     * 序列号
     */
    @Schema(description = "序列号")
    @TableField(value = "serial_number")
    private String serialNumber;

    /**
     * 最小检测距离
     */
    @Schema(description = "设备最小检测距离（m）")
    @TableField(value = "detect_min_dist")
    private Integer detectMinDist;

    /**
     * 最大检测距离
     */
    @Schema(description = "设备最大检测距离（m）")
    @TableField(value = "detect_max_dist")
    private Integer detectMaxDist;

    /**
     * 1倍的水平视场角
     */
    @Schema(description = "1倍水平视场角")
    @TableField(value = "horizontal_fov")
    private BigDecimal horizontalFov;

    /**
     * 1倍的垂直市场角
     */
    @Schema(description = "1倍垂直视场角")
    @TableField(value = "vertical_fov")
    private BigDecimal verticalFov;


    /**
     * 是否自动启动监控任务
     */
    @Schema(description = "是否自动启动监控任务")
    @TableField(value = "auto_start")
    private Boolean autoStart = true;


    /**
     * 控制模式
     */
    @Schema(description = "控制模式")
    @TableField(value = "control_mode")
    private ControlMode controlMode;

    /**
     * ptd控制模式端口
     */
    @TableField(value = "ptd_port")
    private Integer ptdPort;


    /**
     * 是否上下反转,用于云台控制
     */
    @Schema(description = "上下反转")
    @TableField(value = "vertical_flip")
    private Boolean verticalFlip = false;


    /**
     * nvl的频道
     */
    @Schema(description = "频道")
    @TableField(value = "channelno")
    private Integer channelno;

}
